package com.kuaimacode.kframework.mybatis.mapper.user;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kuaimacode.kframework.mybatis.models.user.Order;
import com.kuaimacode.kframework.mybatis.models.user.OrderMore;
import com.kuaimacode.kframework.mybatis.models.user.OrderNear;
import com.kuaimacode.kframework.mybatis.models.user.OrderSimple;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * @author 中元
 * @date 2019/03/18
 */
public interface OrderMapper extends BaseMapper<Order> {
    Order findOrderByOrderNo(String orderNo);

    List<OrderNear> findNearOrderList(@Param("arg0") double lat ,@Param("arg1")double lon,@Param("arg2")Integer distanceLimit,@Param("arg4")Integer status,@Param("arg5")String agentId,@Param("arg6")Long userId);

    List<OrderNear> findOrderByStatus(@Param("status")Integer status,@Param("masterId")Long masterId,@Param("orderNo")String orderNo,@Param("dateFlag")String dateFlag);

    List<OrderNear> findOrderByStatusList(@Param("statusList")List<Integer> statusList,@Param("masterId")Long masterId);

    List<OrderSimple> findAllOrders(@Param("status")Integer status, @Param("userId")Long userId, @Param("type")Integer type, @Param("agentId")String agentId);

    List<OrderSimple> findMasterOrders(@Param("status")Integer status, @Param("masterId")Long masterId);

    OrderMore findOrderById(@Param("id")Long id);

    int currentWeekNum(@Param("statusList")List<Integer> status,@Param("master_id")Long masterId);

    int currentMonthNum(@Param("statusList")List<Integer> status,@Param("master_id")Long masterId);

    List<OrderNear> findOrderByStatusListCurDate(@Param("statusList")List<Integer> statusList,@Param("masterId")Long masterId,String date);

}

